
cat << EOF > $K8_CONFIG_HOME/kube-secheduler


KUBE_SCHEDULER_OPTS="--logtostderr=true --v=4 --master=127.0.0.1:8080 --leader-elect"


EOF


currentPath=$(pwd)

cat << EOF > $currentPath/build/service/kube-scheduler.service

[Unit]
Description=Kubernetes Scheduler
Documentation=https://github.com/kubernetes/kubernetes
 
[Service]
EnvironmentFile=$K8_CONFIG_HOME/kube-scheduler
ExecStart=$K8_SERVER_BIN/kube-scheduler \$KUBE_SCHEDULER_OPTS
Restart=on-failure
 
[Install]
WantedBy=multi-user.target


EOF


sed -i '/kube-scheduler/d' $K8_MASTER_SHELL
sed -i "/daemon-reload/i\cp $currentPath/build/kube-scheduler.service $K8_SERVER_HOME/" $K8_MASTER_SHELL


echo "systemctl enable kube-scheduler " >> $K8_MASTER_SHELL
echo "systemctl stop kube-scheduler " >> $K8_MASTER_SHELL
echo "systemctl start kube-scheduler " >> $K8_MASTER_SHELL

